package com.yao.seckill.web.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * Copyright (C), 2022-2022, 姚兵
 * Author: 32210
 * Date: 2022/9/16 17:55
 * FileName: RedisUtils
 * Description: redis
 */
@Component
@Slf4j
public class RedisUtils {
    @Autowired
    private RedisTemplate<String,Object> redisTemplate;

    public void add(String key,String value){
        log.info("add key={} value={}",key,value);
        redisTemplate.opsForValue().set(key,value);
        log.info("add key={} value={} success",key,value);
    }
}
